 <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               	添加或者修改用户信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form class="form-horizontal" role="form" id="addUserForm">
						 <input type="hidden" name="id" value="${(sysUser.id)!}"/>
						 <div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">用户名</label>
								<div class="col-sm-8">
									<input type="text" name="userName" id="form-field-1" class="col-xs-7 col-sm-7" value="${(sysUser.userName)!}"
									data-rule-required="true" data-msg-required="用户名必填">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-2">用户密码</label>
								<div class="col-sm-8">
									<input type="password" name="password" id="form-field-2" class="col-xs-7 col-sm-7" value="${(sysUser.password)!}"
									data-rule-required="true" data-msg-required="密码必填"
									>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-3">真实姓名</label>
								<div class="col-sm-8">
									<input type="text" name="name" id="form-field-3" class="col-xs-7 col-sm-7" value="${(sysUser.name)!}"
									data-rule-required="true" data-msg-required="真实姓名必填">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-4">联系电话</label>
								<div class="col-sm-8">
									<input type="text" name="mobile" id="form-field-4" class="col-xs-7 col-sm-7" value="${(sysUser.mobile)!}"
									data-rule-required="true" data-msg-required="联系电话必填">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-5">是否客户用户</label>
								<div class="col-sm-5">
									  <select class="col-sm-5" name="isCustomer">
									  <#if user??>
									  <#if user.customer==true>
									  	  <option value="xxy" selected>是</option>
									      <#else>
											  <#if sysUser??>
												  <#if sysUser.isCustomer=='y'>
												  	 <option value="y" selected>是</option>
												  	 <#else>
												  	 <option value="n" selected>否</option>
												  </#if>
												  <#else>
												  <option value="y" selected>是</option>
												  <option value="n">否</option>
										      </#if>
								      </#if>
								      </#if>
								     </select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-7">用户状态</label>
								<div class="col-sm-5">
									  <select class="col-sm-5" name="valid">
									  <#if sysUser??>
										  <#if sysUser.status=='y'>
										  	 <option value="y" selected>启用</option>
										  	 <option value="n">禁用</option>
										  	 <#else>
										  	  <option value="y">启用</option>
										  	 <option value="n" selected>禁用</option>
										  </#if>
										  <#else>
										  <option value="y" selected>启用</option>
										  <option value="n">禁用</option>
								      </#if>
								     </select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right">品牌列表</label>
								<input type="hidden"  name="brandList" value=""/>
								<div class="col-sm-9">
								<select id="brandList" multiple="multiple" class="width-80 chosen-select" data-placeholder="请选品牌列表"
								data="${(sysUser.brandList)!}" data-rule-required="true" data-msg-required="品牌列表必选">
									<#if brands??>
										<#list brands as b>
											<option value="${b!}">${b!}</option>
										</#list>
									</#if>
								</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">拥有权限</label>
								<div class="col-sm-7">
									  <select class="col-sm-7" name="roleId"  data-rule-required="true" data-msg-required="权限必选">
									   <#if roles??>
									     <#list roles as r>
									     	<#if sysUser??>
									        <#if r.id == sysUser.roleId>
									  	 		<option value="${(r.id)!}" selected>${(r.value)!}</option>
									  	 	   <#else>
									  	 	    <option value="${(r.id)!}">${(r.value)!}</option>
									  	 	</#if>
									  	 	<#else>
									  	 	 <option value="${(r.id)!}">${(r.value)!}</option>
									  	 	</#if>
									  	  </#list>
								        </#if>
								     </select>
								</div>
							</div>
						  <div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">备注信息</label>
								<div class="col-sm-5">
									  <textarea class="form-control limited col-sm-5" name="remark">
									  </textarea>
								</div>
							</div>
					</form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-warning" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button" class="btn btn-primary" id="addUserSubmitBtn">
		               	确认添加或修改
		            </button>
		         </div>
	 </div><!-- /.modal-content -->
		<script type="text/javascript">
	(function($){
		$(function(){
			init();
		})
		function init(){
			$("#addUserForm").validate();
			 var arr = $("#brandList").attr("data").split(',');
		        var length = arr.length;
		        var value = '';
		        for(i=0;i<length;i++){
		            value = arr[i];
		            $("#brandList [value='"+value+"']").attr('selected','selected');
		        }
		        $("#brandList").trigger("liszt:updated");
		}
	})($)
		
</script>
	</div>


